<?php
/**
 *
 * @author dinglin
 * 用户信息表 user_info
 */
class Oa_Data_UserInfo{

   private static $instance;
   public static function get_instance(){
        if(!self::$instance) {
            self::$instance = new Oa_Data_UserInfo();
        }
        return self::$instance;
    }
    //所有可能用户状态基准数据
    private static function user_info(){
        $fields = array('user_id','name','email','code','enter_date','indue_date','dimission_date','department_name','department_id','city_name','superior_code','employees_type','job_status','user_type','user_type_date');
        $values =
        array(
                //离职
                6448=>array(6448,'宋毅文','ywsong@anjuke.com','CQD944','2010-07-20 00:00:00','','2011-04-22 00:00:00','',650,'重庆','','','离职',0,0),
                //未入职
                //在职-适用期
                6425=>array(6425,'周燕','yanzhou@anjuke.com','SHF3279','2012-06-19 00:00:00','2012-12-19 00:00:00','','销售助理',530,'上海','SHD1219','试用员工','在职',0,0),
                //在职-转正后的
                6439=>array(6439,'潘皓亮','andypan@anjuke.com','SHD965','2010-08-03 00:00:00','2011-02-03 00:00:00','','初级网络营销顾问(KA2)',530,'上海','SHD1136','正式员工','在职',0,0),
                //在职-HR
                //在职-管理员
                //在职-特殊班别-非销售-非上海
                4183=>array(4183,'陈晓敏','xmchen@anjuke.com','SHD1142','2010-08-03 00:00:00','2011-02-03 00:00:00','','初级网络营销顾问(KA2)',530,'重庆','SHD1136','正式员工','在职',1,20120920),
                //在职-特殊班别-销售-非上海
                6127=>array(6127,'季嘉玫','mayji@anjuke.com','SHD793','2010-08-03 00:00:00','2011-02-03 00:00:00','','销售助理主管',544,'重庆','NJC292','正式员工','在职',1,20120920),
                //在职-特殊班别-销售-上海
                5942=>array(5942,'陈佳','jchen@anjukeinc.com','SHC476','2010-08-03 00:00:00','2011-02-03 00:00:00','','销售助理主管',544,'上海','NJC292','正式员工','在职',1,20120920),
                 //在职-非特殊班别-非销售-非上海
                array(6439,'潘皓亮','andypan@anjuke.com','SHD965','2010-08-03 00:00:00','2011-02-03 00:00:00','','初级网络营销顾问(KA2)',530,'重庆','SHD1136','正式员工','在职',0,0),
                 //在职-非特殊班别-销售-非上海
                array(6439,'潘皓亮','andypan@anjuke.com','SHD965','2010-08-03 00:00:00','2011-02-03 00:00:00','','销售助理主管',544,'重庆','SHD1136','正式员工','在职',0,0),
                //在职-非特殊班别-销售-上海
                array(6439,'潘皓亮','andypan@anjuke.com','SHD965','2010-08-03 00:00:00','2011-02-03 00:00:00','','销售助理主管',544,'上海','SHD1136','正式员工','在职',0,0),
             );
        //数据组合
        $result = array();
        foreach($values as $key => $value){
            foreach ($fields as $k => $f){
                $result[$key][$f] = $value[$k];
            }
        }
        return $result;
    }
    /**
     * 根据user_id 查找用户信息
     * 指定日期
     */
   public static function get_user_by_id($user_id,$date){
       $users =  $this->user_info();
       return $users[$user_id];
   }
   public static function get_all_users(){
      return self::user_info();
   }
}